#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "bot.h"
#include <iostream>
#include <cmath>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
    connect(&maintimer, SIGNAL(timeout()), this, SLOT(MainClockTick()));
    world=new World;
    world->setSceneRect(0, 0, 800, 600);
    world->setItemIndexMethod(QGraphicsScene::NoIndex);
    ui->graphicsView->setScene(world);
    ui->graphicsView->show();
    maintimer.start(30);
}

MainWindow::~MainWindow()
{
    delete ui;QVector2D tmp(100,100);
}

void MainWindow::MainClockTick()
{
    //world->m_bot->step();
    world->collide();
    world->update();


}
